package com.joesem.sale.client.network.data

import android.os.Parcel
import android.os.Parcelable

/**
 * @Time 2023/2/23 22:48:28
 * @Description
 **/
 class AreaMode(
    val adcode: String? = "",
    val citycode: String? = "",
    val create_time: String? = "",
    val create_user: Int? = 0,
    val create_user_name: String? = "",
    val hasChildren: Boolean? = false,
    val id: Int? = 0,
    val lat: Int? = 0,
    val level: Int? = 0,
    val lng: Int? = 0,
    val mark: Int? = 0,
    val name: String? = "",
    val p_adcode: String? = "",
    val pid: Int? = 0,
    val sort: Int? = 0,
):Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readValue(Int::class.java.classLoader) as? Int,
        parcel.readString(),
        parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
        parcel.readValue(Int::class.java.classLoader) as? Int,
        parcel.readValue(Int::class.java.classLoader) as? Int,
        parcel.readValue(Int::class.java.classLoader) as? Int,
        parcel.readValue(Int::class.java.classLoader) as? Int,
        parcel.readValue(Int::class.java.classLoader) as? Int,
        parcel.readString(),
        parcel.readString(),
        parcel.readValue(Int::class.java.classLoader) as? Int,
        parcel.readValue(Int::class.java.classLoader) as? Int
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(adcode)
        parcel.writeString(citycode)
        parcel.writeString(create_time)
        parcel.writeValue(create_user)
        parcel.writeString(create_user_name)
        parcel.writeValue(hasChildren)
        parcel.writeValue(id)
        parcel.writeValue(lat)
        parcel.writeValue(level)
        parcel.writeValue(lng)
        parcel.writeValue(mark)
        parcel.writeString(name)
        parcel.writeString(p_adcode)
        parcel.writeValue(pid)
        parcel.writeValue(sort)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<AreaMode> {
        override fun createFromParcel(parcel: Parcel): AreaMode {
            return AreaMode(parcel)
        }

        override fun newArray(size: Int): Array<AreaMode?> {
            return arrayOfNulls(size)
        }
    }
}